ESLint and Prettier in the backend (#112) #118
Merged
+3,888
−2,690
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #112
What
backend/with the same settings as the frontend (eslint.config.mjs,.prettierrc,.prettierignore), and the scriptslint,formatandformat:check, sonpm run checkruns them..gitattributesinbackend/, so Prettier also passes on Windows (as in Prettier fails on Windows because of CRLF line endings #78).~6.0.2, the same as the frontend. typescript-eslint supports TypeScript up to 6.0, and TypeScript 7 no longer has the API it uses. The code type checks and the tests pass on 6 without changes.App.test.tsxfrom test(frontend): load the lazy pages once before the route tests (#103) #104 formatted, since it made the frontend Prettier check fail.docs/requirements.mdupdated.ESLint found no errors in the backend.
How to review
Commit by commit. The commit
style(backend): format with Prettieronly changes formatting in 50 files and can be skipped.How to test
npm ciinbackend/(new dev dependencies).npm run checkfrom the root: all 9 checks pass, and no step says «not set up».For the rest of the group
This touches almost every file in
backend/src. If you have a branch with backend changes, mergemaininto it after this is merged and runnpm run format --prefix backendto avoid most conflicts.AI
Claude found that typescript-eslint does not support TypeScript 7 and suggested the setup. I made the files and ran the commands myself.